<template>
    <div style="width: 100%;height: 100%;">
      <div ref="container" :style="{'width':width + unit,'height':height + unit}"></div>
    </div>
</template>
<script>
import * as echarts from 'echarts'

export default{
    data(){
        return{

        }
    },
    props:{
        height:{
            type:Number,
            default:100
        },
        width:{
            type:Number,
            default:100
        },
        unit:{
            type:String,
            default:'%'
        },
        echartsData:{
            type:Object,
            default:null
        }
    },
    mounted(){
        var myChart = this.$refs.container
        var  myChartInit = echarts.init(myChart);
        myChartInit.setOption(this.echartsData)
      
    }
}
</script>
<style lang="less" scoped>
</style>